package com.s3.khospitalds.controller;

import com.s3.khospitalds.common.R;
import com.s3.khospitalds.entity.Patienthosp;
import com.s3.khospitalds.entity.Patientlist;
import com.s3.khospitalds.service.impl.PatienthospServiceImpl;
import com.s3.khospitalds.service.impl.PatientlistServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: xw
 * @CreateTime: 2025/3/7
 * @Description: 查看患者信息
 * @Version: 1.0
 */
@RestController
@CrossOrigin(origins = "*")
public class RegisteredController {
    @Autowired
    private PatienthospServiceImpl patienthospService;
    @Autowired
    PatientlistServiceImpl patientlistService;
    @GetMapping("/getAll")
    public R getAll() {
        List<Patientlist> list1 = patientlistService.list();//查询所有处理药信息
        List<Patienthosp> list2 = patienthospService.list();//查询所有住院患者档案表
        return new R().addData("patientlist",list1).addData("patienthosp",list2);
    }
}
